package com.demo.core.model;

import java.util.ArrayList;
import java.util.List;

import com.demo.core.model.support.NestedSetModel;

/**
 * 目录 model类
 */
public class Folder extends NestedSetModel {

	/**
	 * 序列化ID
	 */
	private static final long serialVersionUID = -3405885814349690338L;

	/**
     * 状态，目录正常状态
     */
    public static final String STATUS_NORMAL = "normal";
    
    /**
     * 状态，目录隐藏状态，暂时不用，保留
     */
    public static final String STATUS_HIDE = "hide";
    
    /**
     * 系统内置(由启动加载,不可删除)
     */
    public static final String TYPE_INNER = "inner";
    
    /**
     * 用户自定义(可删除的)
     */
    public static final String TYPE_CUSTOM = "custom";
    
	/**
	 * 站点外键ID
	 */
	private Long siteId;
	
	/**
	 * 目录英文名
	 */
	//private String name;
	
	/**
	 * 唯一标示
	 */
	private String uuid;
	
	/**
	 * 目录的标题
	 */
	private String title;
	
	/**
	 * 文件拥有者SID
	 * T_CORE_SID的外键ID
	 * 安全认证对象
	 */
	private Long ownerSid;
	
	/**
	 * 账号是否可用
	 */
	private boolean enabled;
	
	/**
	 * 角色类型
	 */
	private String type;
	
	/**
	 * 文件夹状态
	 */
	private String status;
	
	/**
	 * 优先级
	 */
	private int priority;
	
	/**
	 * 文件列表
	 */
	private List<File> fileList;
	
	public Long getSiteId() {
		return siteId;
	}
	public void setSiteId(Long siteId) {
		this.siteId = siteId;
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Long getOwnerSid() {
		return ownerSid;
	}
	public void setOwnerSid(Long ownerSid) {
		this.ownerSid = ownerSid;
	}
	public boolean isEnabled() {
		return enabled;
	}
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
	public List<File> getFileList() {
		return fileList;
	}
	public void setFileList(List<File> fileList) {
		this.fileList = fileList;
	}
	
	public void addFile(File file) {
		if (this.fileList == null) {
			fileList = new ArrayList<File>();
		}
		fileList.add(file);
	}
}